Functions
GigE Vision Device

Includes APIs supported by GigE vision devices. More...

Functions

def MV_GIGE_SetEnumDevTimeout (nMilTimeout)
 Sets enumeration timeout duration, range: [1, UINT_MAX). More...
 
def MV_GIGE_ForceIpEx (self, nIP, nSubNetMask, nDefaultGateWay)
 Sets device network parameters forcefully, including IP address, subnet mask, and default gateway. More...
 
def MV_GIGE_SetIpConfig (self, nType)
 Configures IP mode. More...
 
def MV_GIGE_SetNetTransMode (self, nType)
 Sets SDK internal priority network mode. More...
 
def MV_GIGE_GetNetTransInfo (self, pstInfo)
 Gets network transmission information. More...
 
def MV_GIGE_SetDiscoveryMode (nMode)
 Sets the ACK mode of enumeration command. More...
 
def MV_GIGE_SetGvspTimeout (self, nMillisec)
 Sets the timeout duration for image grabbing via GVSP. More...
 
def MV_GIGE_GetGvspTimeout (self, pnMillisec)
 Gets the timeout duration of image grabbing via GVSP. More...
 
def MV_GIGE_SetGvcpTimeout (self, nMillisec)
 Sets timeout duration for GVCP command. More...
 
def MV_GIGE_GetGvcpTimeout (self, pnMillisec)
 Gets timeout duration for GVCP command. More...
 
def MV_GIGE_SetRetryGvcpTimes (self, nRetryGvcpTimes)
 Sets the number of times for resending GVCP command. More...
 
def MV_GIGE_GetRetryGvcpTimes (self, pnRetryGvcpTimes)
 Gets the number of times for resending GVCP command. More...
 
def MV_CC_GetOptimalPacketSize (self)
 Gets the optimal packet size. More...
 
def MV_GIGE_SetResend (self, bEnable, nMaxResendPercent=100, nResendTimeout=50)
 Sets whether to enable packet resending, and sets corresponding parameters. More...
 
def MV_GIGE_SetResendMaxRetryTimes (self, nRetryTimes)
 Sets the maximum command resending times. More...
 
def MV_GIGE_GetResendMaxRetryTimes (self, nRetryTimes)
 Gets the maximum command resending times. More...
 
def MV_GIGE_SetResendTimeInterval (self, nMillisec)
 Sets the time interval of two resending requests for one packet. More...
 
def MV_GIGE_GetResendTimeInterval (self, nMillisec)
 Gets the time interval of two resending requests for one packet. More...
 
def MV_GIGE_SetTransmissionType (self, stTransmissionType)
 Sets the transmission mode, including unicast and multicast. More...
 
def MV_GIGE_IssueActionCommand (pstActionCmdInfo, pstActionCmdResults)
 Sends action commands. More...
 
def MV_GIGE_GetMulticastStatus (pstDevInfo, pbStatus)
 Gets the multicast status. More...
 

Detailed Description

Includes APIs supported by GigE vision devices.

Function Documentation

◆ MV_GIGE_SetEnumDevTimeout()

def MvCameraControl_class.MV_GIGE_SetEnumDevTimeout (   nMilTimeout)

Sets enumeration timeout duration, range: [1, UINT_MAX).

Parameters
nMilTimeout[IN] It refers to the timeout duration. and it should be an integer without symbols. The default value is 100 ms.
Returns
Returns MV_OK for success, and returns corresponding Error Code for failure.
Remarks
  • Call this API before calling enumeration related APIs like MV_CC_EnumDevices(). You can set the maximum timeout duration of the NIC for enumerating GigE vision devices (100 ms by default) to accelerate the enumeration.
  • This API is only supported by GigE vision devices.

◆ MV_GIGE_ForceIpEx()

def MvCameraControl_class.MV_GIGE_ForceIpEx (   self,
  nIP,
  nSubNetMask,
  nDefaultGateWay 
)

Sets device network parameters forcefully, including IP address, subnet mask, and default gateway.

Parameters
handle[IN] It refers to the device handle.
nIP[IN] It refers to the IP address to be set.
nSubNetMask[IN] It refers to the subnet mask.
nDefaultGateWay[IN] It refers to the default gateway.
Returns
Returns MV_OK for success, and returns corresponding Error Code for failure.
Remarks
  • After forcing the configuration of device network parameters (including IP address, subnet mask, and default gateway), create device handle again.
  • This API is supported by GigE vision devices and GenTL devices.
  • The device will restart after you call this API to set network parameters forcefully when the device is in DHCP status.

◆ MV_GIGE_SetIpConfig()

def MvCameraControl_class.MV_GIGE_SetIpConfig (   self,
  nType 
)

Configures IP mode.

Parameters
handle[IN] It refers to the device handle.
nType[IN] It refers to the IP type. See MV_IP_CFG_x for details.
Constant Value Description
MV_IP_CFG_STATIC 0x05000000 Static mode.
MV_IP_CFG_DHCP 0x06000000 DHCP mode.
MV_IP_CFG_LLA 0x04000000 LLA (Link-local address).
Returns
Returns MV_OK for success, and returns corresponding Error Code for failure.
Remarks
This API is only supported by GigE vision devices and GenTL devices. You can send command to set the MVC IP configuration mode, including DHCP and LLA.

◆ MV_GIGE_SetNetTransMode()

def MvCameraControl_class.MV_GIGE_SetNetTransMode (   self,
  nType 
)

Sets SDK internal priority network mode.

Parameters
handle[IN] It refers to the device handle.
nType[IN] It refers to the network transmission mode. See MV_NET_TRANS_x for details.
Constant Value Description
MV_NET_TRANS_DRIVER 0x00000001 Driver mode.
MV_NET_TRANS_SOCKET 0x00000002 Socket mode.
Returns
Returns MV_OK for success, and returns corresponding Error Code for failure.
Remarks
You can call this API to set the internal priority network mode for the SDK (driver mode by default). This API is supported by GigE vision devices only.

◆ MV_GIGE_GetNetTransInfo()

def MvCameraControl_class.MV_GIGE_GetNetTransInfo (   self,
  pstInfo 
)

Gets network transmission information.

Parameters
handle[IN] It refers to the device handle.
pstInfo[IN][OUT] It refers to the network transmission information structure.
Returns
Returns MV_OK for success, and returns corresponding Error Code for failure.
Remarks
Call this API to get information about network transmission after grabbing images via calling MV_CC_StartGrabbing(), including received data size and the number of lost frames. This API is only supported by GigE vision devices.

◆ MV_GIGE_SetDiscoveryMode()

def MvCameraControl_class.MV_GIGE_SetDiscoveryMode (   nMode)

Sets the ACK mode of enumeration command.

Parameters
nMode[IN] It refers to the ACK mode (default broadcast). 0: unicast; 1: broadcast.
Returns
Returns MV_OK for success, and returns corresponding Error Code for failure.
Remarks
This API is only supported by GigE vision devices.

◆ MV_GIGE_SetGvspTimeout()

def MvCameraControl_class.MV_GIGE_SetGvspTimeout (   self,
  nMillisec 
)

Sets the timeout duration for image grabbing via GVSP.

Parameters
handle[IN] It refers to the device handle.
nMillisec[IN] It refers to the timeout duration (300 ms by default), range: [10, UNIT_MAX), unit: millisecond.
Returns
Returns MV_OK for success, and returns corresponding Error Code for failure.
Remarks
After connecting to the device and before starting image grabbing, call this API to set timeout duration for image grabbing via GVSP. Image exception might occur if timeout duration is too short, and the image grabbing duration will become longer if timeout duration is too long.

◆ MV_GIGE_GetGvspTimeout()

def MvCameraControl_class.MV_GIGE_GetGvspTimeout (   self,
  pnMillisec 
)

Gets the timeout duration of image grabbing via GVSP.

Parameters
handle[IN] It refers to the device handle.
pnMillisec[IN][OUT] It refers to the pointer to timeout duration, unit: millisecond.
Returns
Returns MV_OK for success, and returns corresponding Error Code for failure.
Remarks
Call this API to get the current timeout duration of image grabbing via GVSP.

◆ MV_GIGE_SetGvcpTimeout()

def MvCameraControl_class.MV_GIGE_SetGvcpTimeout (   self,
  nMillisec 
)

Sets timeout duration for GVCP command.

Parameters
handle[IN] It refers to the device handle.
nMillisec[IN] It refers to the timeout duration (500 ms by default), range: [0, 10000], unit: millisecond.
Returns
Returns MV_OK for success, and returns corresponding Error Code for failure.
Remarks
After the device is connected, you can call this API to set the timeout duration for GVCP command.

◆ MV_GIGE_GetGvcpTimeout()

def MvCameraControl_class.MV_GIGE_GetGvcpTimeout (   self,
  pnMillisec 
)

Gets timeout duration for GVCP command.

Parameters
handle[IN] It refers to the device handle.
pnMillisec[IN][OUT] It refers to the pointer to timeout duration, unit: millisecond.
Returns
Returns MV_OK for success, and returns corresponding Error Code for failure.
Remarks
Call this API to get the current timeout duration of GVCP command.

◆ MV_GIGE_SetRetryGvcpTimes()

def MvCameraControl_class.MV_GIGE_SetRetryGvcpTimes (   self,
  nRetryGvcpTimes 
)

Sets the number of times for resending GVCP command.

Parameters
handle[IN] It refers to the device handle.
nRetryGvcpTimes[IN] It refers to the number of times for resending, range: [0, 100].
Returns
Returns MV_OK for success, and returns corresponding Error Code for failure.
Remarks
Call this API to increase the resending times when exception occurred during GVCP packet transmission, range: [0, 100]. To some extent, it can prevent the device from getting offline.

◆ MV_GIGE_GetRetryGvcpTimes()

def MvCameraControl_class.MV_GIGE_GetRetryGvcpTimes (   self,
  pnRetryGvcpTimes 
)

Gets the number of times for resending GVCP command.

Parameters
handle[IN] It refers to the device handle.
pnRetryGvcpTimes[IN][OUT] It refers to the pointer to resending times.
Returns
Returns MV_OK for success, and returns corresponding Error Code for failure.
Remarks
Call this API to get the current resending times of GVCP command (3 by default).

◆ MV_CC_GetOptimalPacketSize()

def MvCameraControl_class.MV_CC_GetOptimalPacketSize (   self)

Gets the optimal packet size.

Parameters
handle[IN] It refers to the device handle.
Returns
Returns the optimal packet size.
Remarks
  • This API is supported by GigE vision devices only, and for GigE vision devices, the packet size refers to SCPS.
  • Call this API after MV_CC_OpenDevice() and before MV_CC_StartGrabbing() .
  • This API is not supported by Camera Link devices and USB3 vision devices.
  • This API is not supported by GenTL devices (unsupported protocols). For GigE vision devices added via GenTL, configure GevSCPSPacketSize or configure 1500 as needed.

◆ MV_GIGE_SetResend()

def MvCameraControl_class.MV_GIGE_SetResend (   self,
  bEnable,
  nMaxResendPercent = 100,
  nResendTimeout = 50 
)

Sets whether to enable packet resending, and sets corresponding parameters.

Parameters
handle[IN] It refers to the device handle.
bEnable[IN] Whether to enable packet resending.
nMaxResendPercent[IN] It refers to the maximum resending percent.
nResendTimeout[IN] It refers to the resending timeout duration, range: [0, 10000], unit: millisecond.
Returns
Returns MV_OK for success, and returns corresponding Error Code for failure.
Remarks
Call this API to set resending packet parameters after the device is connected. This API is only supported by GigE vision devices.

◆ MV_GIGE_SetResendMaxRetryTimes()

def MvCameraControl_class.MV_GIGE_SetResendMaxRetryTimes (   self,
  nRetryTimes 
)

Sets the maximum command resending times.

Parameters
handle[IN] It refers to the device handle.
nRetryTimes[IN] It refers to the maximum command resending times, 20 by default.
Returns
Returns MV_OK for success, and returns corresponding Error Code for failure.
Remarks
This API should be called after resending packet is enabled via calling MV_GIGE_SetResend(). If APIs are not called in order, MV_GIGE_GetResendMaxRetryTimes() calling will fail and MV_E_CALLORDER will be returned.

◆ MV_GIGE_GetResendMaxRetryTimes()

def MvCameraControl_class.MV_GIGE_GetResendMaxRetryTimes (   self,
  nRetryTimes 
)

Gets the maximum command resending times.

Parameters
handle[IN] It refers to the device handle.
pnRetryTimes[IN][OUT] It refers to the maximum command resending times.
Returns
Returns MV_OK for success, and returns corresponding Error Code for failure.
Remarks
This API should be called after resending packet is enabled via calling MV_GIGE_SetResend(). If APIs are not called in order, MV_GIGE_GetResendMaxRetryTimes() calling will fail and MV_E_CALLORDER will be returned.

◆ MV_GIGE_SetResendTimeInterval()

def MvCameraControl_class.MV_GIGE_SetResendTimeInterval (   self,
  nMillisec 
)

Sets the time interval of two resending requests for one packet.

Parameters
handle[IN] It refers to the device handle.
nMillisec[IN] It refers to the time interval of two resending requests for one packet. It is 10 ms by default.
Returns
Returns MV_OK for success, and returns corresponding Error Code for failure.
Remarks
This API should be called after resending packet is enabled via calling MV_GIGE_SetResend(). If APIs are not called in order, MV_GIGE_GetResendMaxRetryTimes() calling will fail and MV_E_CALLORDER will be returned.

◆ MV_GIGE_GetResendTimeInterval()

def MvCameraControl_class.MV_GIGE_GetResendTimeInterval (   self,
  nMillisec 
)

Gets the time interval of two resending requests for one packet.

Parameters
handle[IN] It refers to the device handle.
pnMillisec[IN][OUT] It refers to the time interval of two resending requests for one packet.
Returns
Returns MV_OK for success, and returns corresponding Error Code for failure.
Remarks
This API should be called after resending packet is enabled via calling MV_GIGE_SetResend(). If APIs are not called in order, MV_GIGE_GetResendMaxRetryTimes() calling will fail and MV_E_CALLORDER will be returned.

◆ MV_GIGE_SetTransmissionType()

def MvCameraControl_class.MV_GIGE_SetTransmissionType (   self,
  stTransmissionType 
)

Sets the transmission mode, including unicast and multicast.

Parameters
handle[IN] It refers to the device handle.
stTransmissionType[IN] It refers to the transmission mode structure.
Returns
Returns MV_OK for success, and returns corresponding Error Code for failure.
Remarks
Call this API to set the transmission mode as unicast mode and multicast mode. This API is only supported by GigE vision device.

◆ MV_GIGE_IssueActionCommand()

def MvCameraControl_class.MV_GIGE_IssueActionCommand (   pstActionCmdInfo,
  pstActionCmdResults 
)

Sends action commands.

Parameters
pstActionCmdInfo[IN] It refers to the information of action commands.
pstActionCmdResults[IN][OUT] It refers to the list of returned information about action commands.
Returns
Returns MV_OK for success, and returns corresponding Error Code for failure.
Remarks
This API is only supported by GigE vision devices. It supports sending commands to up to 16 multicast addresses simultaneously.

◆ MV_GIGE_GetMulticastStatus()

def MvCameraControl_class.MV_GIGE_GetMulticastStatus (   pstDevInfo,
  pbStatus 
)

Gets the multicast status.

Parameters
pstDevInfo[IN] It refers to the device information structure.
pbStatus[IN][OUT] It refers to the multicast status. true: multicast status, false: not multicast.
Returns
Returns MV_OK for success, and returns corresponding Error Code for failure.
Remarks
  • When enumerating the device, call this API to check if the device is in multicast status without turning on the device.
  • This API is only supported by standard GigE vision devices.